package com.thread.threadfirst.designMode.singleton;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Test {

    public static void main(String[] args) {
        ExecutorService executor =new ThreadPoolExecutor(3,5,200, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(3));
        for (int i=0;i<5;i++){
            executor.execute(()->{
                SingletonInnerClass instance = SingletonInnerClass.getInstance();
                System.out.println(instance);
            });
        }
    }
}
